Skip to content

Clamp panel rects to visible bounds#8056

Open
enomado wants to merge 2 commits intoemilk:mainfrom
enomado:fix-panel-overflow-rect
Open

Clamp panel rects to visible bounds#8056
enomado wants to merge 2 commits intoemilk:mainfrom
enomado:fix-panel-overflow-rect

Conversation

@enomado
Copy link
Copy Markdown
Contributor

@enomado enomado commented Apr 2, 2026

Fixes #8055.

When panel contents overflow beyond the visible clamped bounds, the panel response can become larger than the actual visible panel. That oversized response was then reused by integrations for pointer hit-testing, and its rect was also reused internally for cursor advancement, stored panel state, separator painting, and top-level panel allocation.

This change clamps the outward-facing panel response back to the visible panel bounds with intersect(panel_rect), for both response.rect and response.interact_rect. The fix is applied to both SidePanel and TopBottomPanel, so callers using the returned panel response do not inherit oversized clipped-child bounds.

I verified this against a Bevy + bevy_egui integration where a resizable panel with clipped overflow content incorrectly blocked scene interaction and displaced its effective boundary. After this change, the panel hit area and boundary stay aligned with the visible panel edge.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

Preview is being built...

Preview will be available at https://egui-pr-preview.github.io/pr/8056-fix-panel-overflow-rect

View snapshot changes at kitdiff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resizable Panel stores and paints using overflowed inner rect instead of clamped panel rect

1 participant